<?php
namespace app\user\model;
use think\Model;
use think\model\concern\SoftDelete;

class CustomerTrack extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = 0;
    protected $autoWriteTimestamp = true;
    protected $globalScope = ['shop_id'];
    public function scopeShop_id($query)
    {
        $query->where('shop_id', ShopId());
    }
    
    public function user()
    {
        return $this->belongsTo(User::class,'user_id','id')->bind(['user_name'=>'name']);
    }
    
    
    
}